import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'ad_x_sdk_platform_interface.dart';

/// An implementation of [AdXSdkPlatform] that uses method channels.
class MethodChannelAdXSdk extends AdXSdkPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('ad_x_sdk');

  Future<void> initSDK(Map<String, dynamic> params) async {
    await methodChannel.invokeMethod('initSDK', params);
  }

  Future<void> initRewardAdLoader(Map<String, dynamic> params) async {
    await methodChannel.invokeMethod('initRewardAdLoader', params);
  }

  Future<void> loadRewardAd() async {
    await methodChannel.invokeMethod('loadRewardAd');
  }

  Future<void> showRewardAd() async {
    await methodChannel.invokeMethod('showRewardAd');
  }

  Future<void> loadAndShowRewardAd() async {
    await methodChannel.invokeMethod('loadAndShowRewardAd');
  }

  Future<void> initInterstitialAdLoader(Map<String, dynamic> params) async {
    await methodChannel.invokeMethod('initInterstitialAdLoader', params);
  }

  Future<void> loadInterstitialAd() async {
    await methodChannel.invokeMethod('loadInterstitialAd');
  }

  Future<void> showInterstitialAd() async {
    await methodChannel.invokeMethod('showInterstitialAd');
  }

  Future<void> loadAndShowInterstitialAd() async {
    await methodChannel.invokeMethod('loadAndShowInterstitialAd');
  }
}
